package com.wanxi.test;

public class DiguiJiecheng {
    public static void main(String[] args) {
        int i = 5;//i*(i-1)(i-1-1-1=1)  5*4*3*2*1
        System.out.println(jiecheng(i));
    }

    private static int jiecheng(int i) {
        if (i != 1) {
//            i--;
            return i * jiecheng(--i);
        }
        return 1;
    }
}
